package javase_class_250912;

/**
 * ClassName: StringTest
 * Package: javase_class_250912
 * Description:
 *
 * @Author harkjeans
 * @Create 2025/9/12 9:11
 * @Version 1.0
 */
public class StringTest {
    public static void main(String[] args) {
        Person p1 = new Person();
        Person p2 = new Person();
        System.out.println(p1);//javase_class_250912.Person@4eec7777
        System.out.println(p2);//javase_class_250912.Person@3b07d329
        p1.name  = "Tom";
        p2.name  = "Tom";
        System.out.println(p1.name.equals(p2.name));

        String s1 = "javaEE";
        String s2 = "javaEE";
        String s3 = new String("javaEE");
        String s4 = new String("javaEE");

        System.out.println(s1 == s2);//true
        System.out.println(s1 == s3);//false
        System.out.println(s1 == s4);//false
        System.out.println(s3 == s4);//false

    }

}
class Person{
    String name;
}
